Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

shaara-core

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

shaara-core

Core of the Shaara framework

  • 0.1.0
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

shaara-core

Provide the Kernel of Shaara.

Kernel

The job of the Kernel is to orchestrate the application and it's various components. The base of it is to handle services.

Basic Example :

import Shaara from "shaara-core";

const kernel = await Shaara.Kernel.create({
  getEnvironment: () => {
    return "test";
  },
  getParameters: () => {
    return {
      databaseUsername: "foo",
      databasePassword: "bar",
    }
  },
  getServices: (services, parameters, env) => {
    // parameters contains the parameters given in getParameters
    // env contains the current environment.

    return {
      "random.service": randomService
    }
  }
});

Services

A service is a simple object that do whatever you want. It's completely user defined. It must be registered using the getServices function.

Kernel.create configuration

̀getEnvironment()`

Return the current environment. If not specified, reads process.env.NODE_ENV.

̀getParameters(env : string)`

Return a list of parameters.

getServices(services : {[key: string]: Object}, parameters : Object, env : string)

Return a list of service.

  • services : the kernel may have already defined services (see tasks & presets). In this case you can use some of them in this function to initialize your own services. Note that if you return a service with an already-used name, you will override it.
  • parameters : previously defined parameters
  • env : the current environment

Keywords

FAQs

Package last updated on 12 Aug 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc